import { ApiTags, ApiOperation } from "@nestjs/swagger";
import { Controller, Get, Put, Body, Delete, Param, Post } from "@nestjs/common";
import { AWordService } from './aWord.service';

@ApiTags('每日美句')
@Controller('aWord')
export class AWordController{
    constructor(
        private readonly aWordService:AWordService
    ){}
    
    @Get()
    @ApiOperation({summary:'查询所有每日美句'})
    async find(){
        return await this.aWordService.findAllBlog();
    }

    @Put()
    @ApiOperation({summary:'新增每日美句'})
    async add(@Body() aWord){
        return await this.aWordService.add(aWord);
    }
    @Delete(':id')
    @ApiOperation({summary:'根据id删除每日美句'})
    async remove(@Param('id') aWordId){
        return await this.aWordService.remove(aWordId)
    }

    @Post()
    @ApiOperation({summary:'更改每日美句'})
    async update(@Body() aWord){
        return await this.aWordService.update(aWord);
    }

}